home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / CFUNCTS.LZH / CFUNCTS.DOC < prev    next >
Text File  |  1987-02-03  |  2KB  |  73 lines

  1. Greetings fellow programmer!
  2.  
  3. Here are a few useful functions that I wrote to make life a
  4. little bit easier.
  5. All of these functions (with the exception of rnd.c) will
  6. run only on an IBM-PC/XT/AT (or true compatibles) running
  7. MS-DOS 3.0 or higher.
  8. I compiled all of these functions with Microsoft C 4.0.
  9. -----------------------------------------------------------
  10. card.c   - This little function will do an interrupt to
  11.            to determine whether the machine it is running
  12.            on is using a CGA card or a monochrome (or Hercules)
  13.            card. This is used in the gcls.c, poke.c and peek.c
  14.            functions to determine where screen memory should
  15.            be addressed. This makes these functions portable
  16.            between machines with different graphics cards.
  17.  
  18. gcls.c   - This function will clear the screen. It determines
  19.            the location of screen memory and then fills it
  20.            with blanks (0x0020) with a normal attribute (0x007).
  21.            You must either include card.c or else link with
  22.            card.obj.
  23.  
  24.            usage:
  25.                gcls();
  26.  
  27. poke     - This function accepts 3 arguments.
  28.            1 & 2: an x,y coordinate.
  29.            3: an ascii character code.
  30.            It is used to poke a charater at a given location with
  31.            a normal attribute.
  32.            The cooridinates start at 0,0.
  33.            It determines the beginning of screen memory and then
  34.            calculates the screen position based on the x,y cooridinate
  35.            passed. You must either include card.c or else link with
  36.            card.obj
  37.  
  38.            usage:
  39.                To put a smiley face at 5,5:
  40.                poke(5,5,0);
  41.  
  42.                Or to put the letter "A" at 0,0
  43.                poke(0,0,"A"); or
  44.                poke(0,0,65);
  45.  
  46.  
  47. peek     - This function is the opposite of poke.
  48.            You only pass the x,y coords and it returns the character at
  49.            that location. This also requires card.c or card.obj.
  50.  
  51.            usage:
  52.               c = peek(x,y);
  53.  
  54. rnd      - This function will generate a psuedo random number from
  55.            1 to limit.
  56.            usage:
  57.               x = rnd(limit);
  58.  
  59. ------------------------------------------------------------------------
  60.  
  61. If you have any questions or comments,
  62. please write:
  63.  
  64. Greg Bradburn
  65. 11305 Old Columbia Pike
  66. Silver Spring, MD 20904
  67.  
  68. or call 301-593-9021.
  69.  
  70. Enjoy,
  71.  
  72. Greg.
  73.